Page({
  data: {

    slides: [
      { src: '/pages/imgs/img_1.jpg'},
      { src: '/pages/imgs/img_2.jpg'},
      { src: '/pages/imgs/img_3.jpg'}

    ],
    currentIndex: 0,
  },

  onLoad: function () {
    this.startAutoScroll();
  },

  startAutoScroll: function () {
    const that = this;
    setInterval(function () {
      that.setData({
        currentIndex: (that.data.currentIndex + 1) % that.data.slides.length,
      });
    }, 3000); // 每隔3秒切换一张图片
  },
});
